treeview column: Make final
authorMatthias Clasen <mclasen@redhat.com>
Wed, 29 May 2019 01:42:38 +0000 (21:42 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 29 May 2019 03:22:57 +0000 (23:22 -0400)
gtk/gtktreeviewcolumn.c
gtk/gtktreeviewcolumn.h
testsuite/gtk/cellarea.c

index 6bba42a024ad81ed3fe9f7f342b37d6747e7e0f0..13997d238382d003b58b967810b0be1a85fa7019 100644 (file)
@@ -133,6 +133,23 @@ static void gtk_tree_view_column_set_attributesv               (GtkTreeViewColum
 /* GtkBuildable implementation */
 static void gtk_tree_view_column_buildable_init                 (GtkBuildableIface     *iface);
 
+typedef struct _GtkTreeViewColumnClass   GtkTreeViewColumnClass;
+typedef struct _GtkTreeViewColumnPrivate GtkTreeViewColumnPrivate;
+
+struct _GtkTreeViewColumn
+{
+  GInitiallyUnowned parent_instance;
+
+  GtkTreeViewColumnPrivate *priv;
+};
+
+struct _GtkTreeViewColumnClass
+{
+  GInitiallyUnownedClass parent_class;
+
+  void (*clicked) (GtkTreeViewColumn *tree_column);
+};
+
 
 struct _GtkTreeViewColumnPrivate 
 {
index 0c5d022f5975ef5944302ac7f5f198d303149942..801c74862785adc6d0c1c3b0b658273ae07dac56 100644 (file)
@@ -33,14 +33,9 @@ G_BEGIN_DECLS
 
 #define GTK_TYPE_TREE_VIEW_COLUMN           (gtk_tree_view_column_get_type ())
 #define GTK_TREE_VIEW_COLUMN(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE_VIEW_COLUMN, GtkTreeViewColumn))
-#define GTK_TREE_VIEW_COLUMN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_VIEW_COLUMN, GtkTreeViewColumnClass))
 #define GTK_IS_TREE_VIEW_COLUMN(obj)        (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TREE_VIEW_COLUMN))
-#define GTK_IS_TREE_VIEW_COLUMN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE_VIEW_COLUMN))
-#define GTK_TREE_VIEW_COLUMN_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TREE_VIEW_COLUMN, GtkTreeViewColumnClass))
 
 typedef struct _GtkTreeViewColumn        GtkTreeViewColumn;
-typedef struct _GtkTreeViewColumnClass   GtkTreeViewColumnClass;
-typedef struct _GtkTreeViewColumnPrivate GtkTreeViewColumnPrivate;
 
 /**
  * GtkTreeViewColumnSizing:
@@ -81,26 +76,6 @@ typedef void (* GtkTreeCellDataFunc) (GtkTreeViewColumn *tree_column,
                                      gpointer           data);
 
 
-struct _GtkTreeViewColumn
-{
-  GInitiallyUnowned parent_instance;
-
-  GtkTreeViewColumnPrivate *priv;
-};
-
-struct _GtkTreeViewColumnClass
-{
-  GInitiallyUnownedClass parent_class;
-
-  void (*clicked) (GtkTreeViewColumn *tree_column);
-
-  /* Padding for future expansion */
-  void (*_gtk_reserved1) (void);
-  void (*_gtk_reserved2) (void);
-  void (*_gtk_reserved3) (void);
-  void (*_gtk_reserved4) (void);
-};
-
 GDK_AVAILABLE_IN_ALL
 GType                   gtk_tree_view_column_get_type            (void) G_GNUC_CONST;
 GDK_AVAILABLE_IN_ALL
index 4a7595ef11f8ef8dc2e2601f6c555a3765dcfe25..1319ad5fb126d5495dbe28ac522df4f6f9d9832a 100644 (file)
@@ -255,116 +255,6 @@ test_column_object_new (void)
   g_object_unref (col);
 }
 
-typedef GtkTreeViewColumn MyTreeViewColumn;
-typedef GtkTreeViewColumnClass MyTreeViewColumnClass;
-
-GType my_tree_view_column_get_type (void);
-
-G_DEFINE_TYPE (MyTreeViewColumn, my_tree_view_column, GTK_TYPE_TREE_VIEW_COLUMN)
-
-static void
-my_tree_view_column_class_init (MyTreeViewColumnClass *klass)
-{
-}
-
-static void
-my_tree_view_column_init (MyTreeViewColumn *col)
-{
-  GtkCellArea *area;
-
-  if (subclass_init == 0)
-    {
-      /* do nothing to area */
-    }
-  else if (subclass_init == 1)
-    {
-      area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (col));
-      g_assert (GTK_IS_CELL_AREA_BOX (area));
-      g_assert (gtk_orientable_get_orientation (GTK_ORIENTABLE (area)) == GTK_ORIENTATION_HORIZONTAL);
-      gtk_orientable_set_orientation (GTK_ORIENTABLE (area), GTK_ORIENTATION_VERTICAL);
-    }
-}
-
-/* test that a column subclass has an area */
-static void
-test_column_subclass0 (void)
-{
-  GtkTreeViewColumn *col;
-  GtkCellArea *area;
-
-  subclass_init = 0;
-
-  col = g_object_new (my_tree_view_column_get_type (), NULL);
-  area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (col));
-  g_assert (GTK_IS_CELL_AREA_BOX (area));
-  g_assert (gtk_orientable_get_orientation (GTK_ORIENTABLE (area)) == GTK_ORIENTATION_HORIZONTAL);
-
-  g_object_ref_sink (col);
-  g_object_unref (col);
-}
-
-/* test that a column subclass keeps the provided area */
-static void
-test_column_subclass1 (void)
-{
-  GtkTreeViewColumn *col;
-  GtkCellArea *area;
-
-  subclass_init = 0;
-
-  area = gtk_cell_area_box_new ();
-  col = g_object_new (my_tree_view_column_get_type (), "cell-area", area, NULL);
-  g_assert (area == gtk_cell_layout_get_area (GTK_CELL_LAYOUT (col)));
-  g_assert (gtk_orientable_get_orientation (GTK_ORIENTABLE (area)) == GTK_ORIENTATION_HORIZONTAL);
-
-  g_object_ref_sink (col);
-  g_object_unref (col);
-}
-
-/* test we can access the area in subclass init */
-static void
-test_column_subclass2 (void)
-{
-  GtkTreeViewColumn *col;
-  GtkCellArea *area;
-
-  subclass_init = 1;
-
-  col = g_object_new (my_tree_view_column_get_type (), NULL);
-  area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (col));
-  g_assert (GTK_IS_CELL_AREA_BOX (area));
-  g_assert (gtk_orientable_get_orientation (GTK_ORIENTABLE (area)) == GTK_ORIENTATION_VERTICAL);
-
-  g_object_ref_sink (col);
-  g_object_unref (col);
-}
-
-static void
-test_column_subclass3_subprocess (void)
-{
-  GtkTreeViewColumn *col;
-  GtkCellArea *area;
-
-  subclass_init = 1;
-
-  area = gtk_cell_area_box_new ();
-  col = g_object_new (my_tree_view_column_get_type (), "cell-area", area, NULL);
-  g_assert (area == gtk_cell_layout_get_area (GTK_CELL_LAYOUT (col)));
-  g_assert (gtk_orientable_get_orientation (GTK_ORIENTABLE (area)) == GTK_ORIENTATION_VERTICAL);
-
-  g_object_ref_sink (col);
-  g_object_unref (col);
-}
-
-/* test we get a warning if an area is provided, but ignored */
-static void
-test_column_subclass3 (void)
-{
-  g_test_trap_subprocess ("/tests/column-subclass3/subprocess", 0, 0);
-  g_test_trap_assert_failed ();
-  g_test_trap_assert_stderr ("*ignoring construct property*");
-}
-
 /* test that we have a cell area after new() */
 static void
 test_completion_new (void)
@@ -433,11 +323,6 @@ main (int argc, char *argv[])
   g_test_add_func ("/tests/column-new", test_column_new);
   g_test_add_func ("/tests/column-new-with-area", test_column_new_with_area);
   g_test_add_func ("/tests/column-object-new", test_column_object_new);
-  g_test_add_func ("/tests/column-subclass0", test_column_subclass0);
-  g_test_add_func ("/tests/column-subclass1", test_column_subclass1);
-  g_test_add_func ("/tests/column-subclass2", test_column_subclass2);
-  g_test_add_func ("/tests/column-subclass3", test_column_subclass3);
-  g_test_add_func ("/tests/column-subclass3/subprocess", test_column_subclass3_subprocess);
 
   g_test_add_func ("/tests/completion-new", test_completion_new);
   g_test_add_func ("/tests/completion-new-with-area", test_completion_new_with_area);